
package com.ymk.base.config;

import com.alibaba.fastjson.JSON;
import com.ymk.bo.user.SopUserBO;
import com.ymk.core.constants.SysConstants;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;

@Component
public class BaseAdminConfig implements InitializingBean {

    @Override
    public void afterPropertiesSet() throws Exception {
        SopUserBO sysUserBO = new SopUserBO();
        sysUserBO.setId(1);
        this.redisTemplate.opsForValue().set(SysConstants.REDIS_KEY_JWT + SysConstants.DEFAULT_ADMIN_TOKEN, JSON.toJSONString(sysUserBO));
    }

    @Autowired
    private RedisTemplate<String, String> redisTemplate;
}

